
import { Action } from '@ngrx/store';

import { TreeItem } from '../../components';

export enum OwnActionTypes {
    LOAD_OWN = '[Own] Load Own',
    LOAD_OWN_FAIL = '[Own] Load Own Fail',
    LOAD_OWN_SUCCESS = '[Own] Load Own Success'
}

export class LoadOwn implements Action {
    readonly type = OwnActionTypes.LOAD_OWN;
}

export class LoadOwnFail implements Action {
    readonly type = OwnActionTypes.LOAD_OWN_FAIL;
    constructor(public payload: any) {}
}

export class LoadOwnSuccess implements Action {
    readonly type = OwnActionTypes.LOAD_OWN_SUCCESS;
    constructor(public payload: TreeItem[]) {}
}

export type OwnAction
    = LoadOwn
    | LoadOwnFail
    | LoadOwnSuccess;